package com.aspose.cells;

import java.util.List;

class zjl {
   static float a(zafz var0, boolean var1) throws Exception {
      com.aspose.cells.b.a.b.zt var2 = new com.aspose.cells.b.a.b.zt(480.0F, 288.0F);
      float var3 = 250.0F;
      float var4 = var3;
      if (var1) {
         if ((float)var0.a() > var2.b()) {
            var4 = var3 - ((float)var0.a() - var2.b()) / var2.b() * 100.0F;
         }
      } else if ((float)var0.b() > var2.c()) {
         var4 = var3 - ((float)var0.b() - var2.c()) / var2.c() * 100.0F;
      }

      if (var4 < 100.0F) {
         var4 = 100.0F;
      }

      return var4;
   }

   static boolean a(double[] var0, double[] var1, List var2, int var3, int var4, double var5, double var7) {
      var1[0] = 0.0D;
      int var9;
      zagd var10;
      double var11;
      if (var0[0] >= 0.0D) {
         if (var0[0] > 0.0D && var5 <= 0.0D || var0[0] == 0.0D && var5 < 0.0D) {
            var0[0] = 0.0D;
            var1[0] = 0.0D;
            return false;
         }

         for(var9 = 0; var9 < var3; ++var9) {
            var10 = ((zahv)var2.get(var9)).k().a(var4);
            if (var10 != null) {
               var11 = var10.v();
               if (var11 >= 0.0D) {
                  if (var1[0] + var11 > var5) {
                     var1[0] = var5;
                     var0[0] = 0.0D;
                     return false;
                  }

                  var1[0] += var11;
               }
            }
         }

         if (var0[0] + var1[0] <= var5) {
            var1[0] += var0[0];
         } else {
            var0[0] = var5 - var1[0];
            var1[0] = var5;
         }
      } else {
         if (var0[0] < 0.0D && var7 >= 0.0D || var0[0] == 0.0D && var7 > 0.0D) {
            var0[0] = 0.0D;
            var1[0] = 0.0D;
            return false;
         }

         for(var9 = 0; var9 < var3; ++var9) {
            var10 = ((zahv)var2.get(var9)).k().a(var4);
            if (var10 != null) {
               var11 = var10.v();
               if (var11 < 0.0D) {
                  if (var1[0] + var11 < var7) {
                     var1[0] = var7;
                     var0[0] = 0.0D;
                     return false;
                  }

                  var1[0] += var11;
               }
            }
         }

         if (var0[0] + var1[0] >= var7) {
            var1[0] += var0[0];
         } else {
            var0[0] = var7 - var1[0];
            var1[0] = var7;
         }
      }

      return true;
   }

   static double a(List var0, int var1) {
      double var2 = 0.0D;

      for(int var4 = 0; var4 < var0.size(); ++var4) {
         zagd var5 = ((zahv)var0.get(var4)).k().a(var1);
         if (var5 != null) {
            double var6 = var5.v();
            var2 += Math.abs(var6);
         }
      }

      return var2;
   }

   static boolean a(double[] var0, double[] var1, List var2, int var3, int var4, zafo var5, double var6) {
      double var8 = var5.z() * var6 / 100.0D;
      double var10 = var5.D() * var6 / 100.0D;
      return a(var0, var1, var2, var3, var4, var8, var10);
   }

   static void a(zafo var0, zafo var1, zahw var2, zahv var3) {
      if (!b(var3.m())) {
         if (!(var3 instanceof zbcq) || !a(var3.m())) {
            int var4;
            int var5;
            zagd var6;
            if (var0.n() && c(var3.m())) {
               for(var4 = 0; var4 < var2.getCount(); ++var4) {
                  for(var5 = 0; var5 < var2.a(var4).k().getCount(); ++var5) {
                     var6 = var2.a(var4).k().a(var5);
                     if (var6 != null) {
                        if (var6.q() > 0.0D) {
                           var6.a(com.aspose.cells.b.a.zq.a(var6.q(), var0.o()));
                        } else {
                           var6.a(true);
                        }
                     }
                  }
               }
            }

            if (var1.n()) {
               for(var4 = 0; var4 < var2.getCount(); ++var4) {
                  for(var5 = 0; var5 < var2.a(var4).k().getCount(); ++var5) {
                     var6 = var2.a(var4).k().a(var5);
                     if (var6 != null) {
                        if (var6.v() > 0.0D) {
                           var6.c(com.aspose.cells.b.a.zq.a(var6.v(), var1.o()));
                        } else {
                           var6.a(true);
                        }
                     }
                  }
               }
            }

         }
      }
   }

   static boolean a(int var0) {
      switch(var0) {
      case 1:
      case 4:
      case 7:
      case 10:
      case 15:
      case 19:
      case 22:
      case 25:
      case 29:
      case 32:
      case 38:
      case 41:
      case 51:
      case 54:
         return true;
      case 2:
      case 3:
      case 5:
      case 6:
      case 8:
      case 9:
      case 11:
      case 12:
      case 13:
      case 14:
      case 16:
      case 17:
      case 18:
      case 20:
      case 21:
      case 23:
      case 24:
      case 26:
      case 27:
      case 28:
      case 30:
      case 31:
      case 33:
      case 34:
      case 35:
      case 36:
      case 37:
      case 39:
      case 40:
      case 42:
      case 43:
      case 44:
      case 45:
      case 46:
      case 47:
      case 48:
      case 49:
      case 50:
      case 52:
      case 53:
      default:
         return false;
      }
   }

   static boolean b(int var0) {
      switch(var0) {
      case 2:
      case 5:
      case 8:
      case 11:
      case 16:
      case 20:
      case 23:
      case 26:
      case 30:
      case 33:
      case 39:
      case 42:
      case 52:
      case 55:
         return true;
      case 3:
      case 4:
      case 6:
      case 7:
      case 9:
      case 10:
      case 12:
      case 13:
      case 14:
      case 15:
      case 17:
      case 18:
      case 19:
      case 21:
      case 22:
      case 24:
      case 25:
      case 27:
      case 28:
      case 29:
      case 31:
      case 32:
      case 34:
      case 35:
      case 36:
      case 37:
      case 38:
      case 40:
      case 41:
      case 43:
      case 44:
      case 45:
      case 46:
      case 47:
      case 48:
      case 49:
      case 50:
      case 51:
      case 53:
      case 54:
      default:
         return false;
      }
   }

   static boolean c(int var0) {
      switch(var0) {
      case 12:
      case 13:
      case 60:
      case 61:
      case 62:
      case 63:
      case 64:
         return true;
      default:
         return false;
      }
   }
}
